using B.S.Domain.InvoiceManagement;
using B.S.Requst;
using MediatR;
using System.Collections.Generic;

namespace B.S.Data.MES.API.Applications.B.S.KApplications.Command.InvoiceCommand
{
    /// <summary>
    /// 添加销售发票命令
    /// 用于处理销售发票的新增请求
    /// </summary>
    public class AddSalesInvoiceCommand : IRequest<APIRequst<int>>
    {
        /// <summary>
        /// 发票编号
        /// </summary>
        public string InvoiceNo { get; set; }

        /// <summary>
        /// 关联的订单ID
        /// </summary>
        public int OrderId { get; set; }

        /// <summary>
        /// 客户ID
        /// </summary>
        public int CustomerId { get; set; }

        /// <summary>
        /// 发票金额
        /// </summary>
        public decimal InvoiceAmount { get; set; }

        /// <summary>
        /// 开票日期
        /// </summary>
        public System.DateTime InvoiceDate { get; set; }

        /// <summary>
        /// 发票类型
        /// </summary>
        public string InvoiceType { get; set; }

        /// <summary>
        /// 发票状态
        /// 0：待开具，1：已开具，2：已作废，3：已红冲
        /// </summary>
        public int InvoiceStatus { get; set; }

        /// <summary>
        /// 税率
        /// </summary>
        public decimal TaxRate { get; set; }

        /// <summary>
        /// 税额
        /// </summary>
        public decimal TaxAmount { get; set; }

        /// <summary>
        /// 不含税金额
        /// </summary>
        public decimal SubtotalAmount { get; set; }

        /// <summary>
        /// 备注信息
        /// </summary>
        public string Remarks { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateName { get; set; }

        /// <summary>
        /// 发票明细列表
        /// </summary>
        public List<AddInvoiceDetailDto> InvoiceDetails { get; set; }
    }

    /// <summary>
    /// 发票明细添加DTO
    /// </summary>
    public class AddInvoiceDetailDto
    {
        /// <summary>
        /// 商品名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public decimal Quantity { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal UnitPrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 税率
        /// </summary>
        public decimal TaxRate { get; set; }

        /// <summary>
        /// 税额
        /// </summary>
        public decimal TaxAmount { get; set; }

        /// <summary>
        /// 不含税金额
        /// </summary>
        public decimal SubtotalAmount { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }
    }
}